﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;

namespace AsyncStudy
{
    class Program
    {
        static void Main(string[] args)
        {
            var content = Download("http://www.baidu.com/");

            Console.WriteLine("在内容输出之前输出");
            
            Console.WriteLine(content.Result);
        }

        private static async Task<string> Download(string url)
        {
            Console.WriteLine("开始下载");

            var content = await new WebClient().DownloadStringTaskAsync(url);

            return content;
        }
    }
}
